home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / brklyprl.lha / Emulator / Benchmarks / concat.pl next >
Encoding:
Text File  |  1989-04-14  |  466 b   |  20 lines

  1.  
  2. /* Copyright (C) 1988, 1989 Herve' Touati, Aquarius Project, UC Berkeley */
  3.  
  4. %    concat (con1, con6)
  5. %    These two tests are simple examples of the concat predicate
  6. %    con1 is determinate, con6 is non-determinate getting all 6 answers
  7.  
  8. main :- concat1, !, concat6.
  9.  
  10. concat1 :- concat([a,b,c],[d,e],X),  % con1
  11.     write(X),nl.
  12. concat6 :- concat(X,Y,[a,b,c,d,e]),  % con6
  13.     write(X),nl,
  14.     write(Y),nl,nl,
  15.     fail.
  16.  
  17. concat([],L,L).
  18. concat([X|L1],L2,[X|L3]) :- concat(L1,L2,L3).
  19.  
  20.